package com.ruoyi.safe.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.safe.mapper.CommonCooperatorQualificationMapper;
import com.ruoyi.safe.domain.CommonCooperatorQualification;
import com.ruoyi.safe.service.ICommonCooperatorQualificationService;

/**
 * 合作单位-企业资质Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-11-08
 */
@Service
public class CommonCooperatorQualificationServiceImpl implements ICommonCooperatorQualificationService 
{
    @Autowired
    private CommonCooperatorQualificationMapper commonCooperatorQualificationMapper;

    /**
     * 查询合作单位-企业资质
     * 
     * @param id 合作单位-企业资质主键
     * @return 合作单位-企业资质
     */
    @Override
    public CommonCooperatorQualification selectCommonCooperatorQualificationById(Long id)
    {
        return commonCooperatorQualificationMapper.selectCommonCooperatorQualificationById(id);
    }

    /**
     * 查询合作单位-企业资质列表
     * 
     * @param commonCooperatorQualification 合作单位-企业资质
     * @return 合作单位-企业资质
     */
    @Override
    public List<CommonCooperatorQualification> selectCommonCooperatorQualificationList(CommonCooperatorQualification commonCooperatorQualification)
    {
        return commonCooperatorQualificationMapper.selectCommonCooperatorQualificationList(commonCooperatorQualification);
    }

    /**
     * 新增合作单位-企业资质
     * 
     * @param commonCooperatorQualification 合作单位-企业资质
     * @return 结果
     */
    @Override
    public int insertCommonCooperatorQualification(CommonCooperatorQualification commonCooperatorQualification)
    {
        commonCooperatorQualification.setCreateTime(DateUtils.getNowDate());
        commonCooperatorQualification.setCreateBy(SecurityUtils.getUsername());
        return commonCooperatorQualificationMapper.insertCommonCooperatorQualification(commonCooperatorQualification);
    }

    /**
     * 修改合作单位-企业资质
     * 
     * @param commonCooperatorQualification 合作单位-企业资质
     * @return 结果
     */
    @Override
    public int updateCommonCooperatorQualification(CommonCooperatorQualification commonCooperatorQualification)
    {
        commonCooperatorQualification.setUpdateTime(DateUtils.getNowDate());
        commonCooperatorQualification.setUpdateBy(SecurityUtils.getUsername());
        return commonCooperatorQualificationMapper.updateCommonCooperatorQualification(commonCooperatorQualification);
    }

    /**
     * 批量删除合作单位-企业资质
     * 
     * @param ids 需要删除的合作单位-企业资质主键
     * @return 结果
     */
    @Override
    public int deleteCommonCooperatorQualificationByIds(Long[] ids)
    {
        return commonCooperatorQualificationMapper.deleteCommonCooperatorQualificationByIds(ids);
    }

    /**
     * 删除合作单位-企业资质信息
     * 
     * @param id 合作单位-企业资质主键
     * @return 结果
     */
    @Override
    public int deleteCommonCooperatorQualificationById(Long id)
    {
        return commonCooperatorQualificationMapper.deleteCommonCooperatorQualificationById(id);
    }
}
